<?php

/**
 * +------ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER * ---------+
 * +----------------------------------------------------------------------------+
 * | PHPKiisf - Keep It in Simple Framework					|
 * | Version 1.0								|
 * | Copyright (C) <2013>  Mario Cezzare <mcezzare@gmail.com>			|
 * | Blog: http://mcezzare.blogspot.com.br					|
 * |										|
 * | This program is part of PHPKiisf, and is free software: you can		|
 * | redistribute it and/or modify it under the terms of the GNU 		|
 * | General Public License as published by					|
 * | the Free Software Foundation, either version 3 of the License, or		|
 * | (at your option) any later version.					|					|
 * |										|									|
 * | This program is distributed in the hope that it will be useful,		|
 * | but WITHOUT ANY WARRANTY; without even the implied warranty of		|
 * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the		|
 * | GNU General Public License for more details.				|
 * | You should have received a copy of the GNU General Public License		|
 * | along with this program.  If not, see <http://www.gnu.org/licenses/>.	|
 * +----------------------------------------------------------------------------+
 * | Author : <Mario Cezzare Angelicola Chiodi> <mcezzare@gmail.com>		|
 * +----------------------------------------------------------------------------+
 * | Contributors								|
 * |										|
 * +----------------------------------------------------------------------------+
 *
 */
/**
 * This file is the default example of use
 *
 * @package	Controllers
 * @access	public
 * @since	2013-03-08
 * @author	Mario Cezzare <mcezzare@gmail.com>
 */

/**
 * Class Example Controller
 */
class example_controller extends default_controller {

	public static $_info = array() ;
	private static $_default_config ;
	private static $_default_template_section ;

	/**
	 * PHP Magic, used on operator new called
	 * Example : $object = new class_object();
	 */
	public function __construct() {
		base_template::init() ;
		self::$_default_config = config::get_config() ;
		/* defined in phpkiisf.ini, Section EXAMPLES */
		self::$_default_template_section = "EXAMPLES_HOME" ;
	}

	/**
	 * Static method used by autoloader
	 */
	public static function init() {

	}

	/**
	 * Include the default template
	 *
	 * @param Array $options , some useful params to control
	 * the default template behavior
	 */
	public static function simple_example( $options = null ) {

		$include_file = self::get_template( self::$_default_template_section ) ;
		/* If exists,  include the template, defined in phpkiisf.ini */
		if ( !self::include_template( $include_file ) ) {

		}
	}

	/**
	 * Include the default template
	 *
	 * @param Array $options , some useful params to control
	 * the default template behavior like a test action
	 */
	public static function medium_example( $options = null ) {
		$include_file = self::get_template( self::$_default_template_section ) ;
		/* If exists,  include the template, defined in phpkiisf.ini */
		$params = array(
			"test" => true ,
			"uri" => "/test" ,
		) ;
		if ( !self::include_template( $include_file , $params ) ) {

		}
	}

	/**
	 * Include the default template, informing some variables like
	 * an alternative_file whithout the extension .inc.php
	 *
	 * @param Array $options , some useful params to control
	 * the default template behavior
	 */
	public static function advanced_example( $options = null ) {
		/* If exists,  include the template, defined in phpkiisf.ini */
		$include_file = self::get_template( self::$_default_template_section ) ;
		/**
		 * Informing the alternative file to load
		 */
		$params = array(
			"alternative_file" => "pages/about" ,
			"uri" => "/about" ,
			"section_name" => "About" ,
		) ;

		if ( !self::include_template( $include_file , $params ) ) {

		}
	}

	/**
	 * Include the default template, informing some variables like
	 * an alternative_file whithout the extension .inc.php
	 *
	 * @param Array $options , some useful params to control
	 * the default template behavior
	 */
	public static function display_php_examples( $options = null ) {
		/* If exists,  include the template, defined in phpkiisf.ini */
		$include_file = self::get_template( self::$_default_template_section ) ;
		/**
		 * Informing the alternative file to load
		 */
		$params = array(
			"alternative_file" => "pages/examples_phpkiisf" ,
			"uri" => "/examples/php" ,
			"section_name" => "PHP Examples" ,
		) ;
		if ( !self::include_template( $include_file , $params ) ) {

		}
	}

	/**
	 * Include the default template, informing some variables like
	 * an alternative_file whithout the extension .inc.php
	 *
	 * @param Array $options , some useful params to control
	 * the default template behavior
	 */
	public static function display_boilerplate_examples( $options = null ) {
		/* If exists,  include the template, defined in phpkiisf.ini */
		$include_file = self::get_template( self::$_default_template_section ) ;
		/**
		 * Informing the alternative file to load
		 */
		$params = array(
			"alternative_file" => "pages/examples_boilerplate" ,
			"uri" => "/examples/boilerplate" ,
			"section_name" => "Boilerplate Examples" ,
		) ;
		if ( !self::include_template( $include_file , $params ) ) {

		}
	}

	/**
	 * Load the "famous index.php"
	 * @param type $params
	 * @override
	 */
	public static function display_index( $params = null ) {
//				self::display_php_examples();
		$include_file = self::get_template( self::$_default_template_section ) ;
		if ( !self::include_template( $include_file , $params ) ) {

		}
	}

}

?>